<!DOCTYPE html>
<html xmlns="http://www.w3c.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta charset="UTF-8" />
	<script type="text/javascript"
		src="resources/js/jquery/jquery-plugins.js?ln=primefaces"></script>

	<!-- TEMPLATE -->

	<meta name="description"
		content="Clean Responsive One Page V-card by Benaissa Ghrib" />
	<meta name="keywords"
		content="HTML, CSS, JavaScript, Template, Minimal, responsive one page template, PHP, One page template" />
	<meta name="author" content="Benaissa Ghrib" />
	<meta name="viewport"
		content="width=device-width, initial-scale=1, maximum-scale=1" />
	<link rel="stylesheet" href="resources/css/main.css" />
	<link rel="stylesheet"
		href="resources/fancybox/jquery.fancybox-1.3.4.css" />
	<link rel="stylesheet" href="resources/css/flexslider.css" />
	<link rel="stylesheet" href="resources/css/fontello.css" />
	<!--[if IE 7]>
		    <link rel="stylesheet" href="resources/css/fontello-ie7.css">
		<![endif]-->
	<link rel="stylesheet" type="text/css"
		href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,300,800,700,400italic|PT+Serif:400,400italic" />

	<!--[if lt IE 9]>
		<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->

	<!--[if lt IE 8]>
		<style>
		/* For IE < 8 (trigger hasLayout) */
		.clearfix {
		    zoom:1;
		}
		</style>
		<![endif]-->

	<!-- /TEMPLATE -->

	<title>Online Store Retailer</title>
</h:head>

<h:body>

	<!-- TEMPLATE -->

	<!--Wrapper-->
	<div id="wrapper">
		<!--Main header-->
		<section id="header">
			<div id="innerHeader">
				<!--Header-->
				<header class="clearfix">
					<!--Logo-->
					<div id="logo">
						<h1>
							<a href="index.xhtml">Online Store <span>Retailer</span></a>
						</h1>
					</div>
					<!--End logo-->
					<h:form style="width: 100%; text-align: right;">
						<p>
							Hola <b><h:outputText value="#{sessionScope.user.nombre}"></h:outputText></b>
							<c:if test="${sessionScope.user != null}">
							 	| <p:commandLink value="Cerrar sesión"
									action="#{AutenticacionBean.cerrarSesion}" ajax="false"></p:commandLink>
							</c:if>
						</p>
					</h:form>
				</header>
				<!--End header-->
			</div>

			<p:menubar model="#{MenuBean.model}" id="OSRMenu" />

			<!--End inner header-->
		</section>
		<!--End main header-->

		<!--Main content-->
		<div id="mainContent" class="clearfix">

			<!--Slider-->
			<div id="slider">
				<div id="slideShow" class="flexslider">
					<ul class="slides">
						<li><img src="resources/images/sliderImages/slide1.jpg"
							alt="" /></li>
						<li><img src="resources/images/sliderImages/slide2.jpg"
							alt="" /></li>
					</ul>
				</div>
			</div>
			<!--End slider-->

			<!--Inner Content-->
			<div id="innerContent" class="clearfix">
				<!--Anota-->
				<div id="anota">
					<div>
						<h1>Online Store Retailer</h1>
						<h2>Una tienda en linea con fines académicos</h2>
					</div>
					<div class="arrAnota"></div>
				</div>
				<!--End anota-->

				<!--Contact-->
				<section id="contact" class="clearfix">
					<!--Title-->
					<div class="title">
						<div>
							<h1>Estado de Compra</h1>
							<h4>Modificacion del estado de compra.</h4>
						</div>
						<div class="titleArrow"></div>
					</div>
					<!--End title-->

					<!--Inner contact-->
					<div id="innerContact" class="clearfix">
						<h:form style="width: 100%;">
							<p:panel header="Modificar Estado de Compra">
								<table>

									<tr>
										<td><p:outputLabel>Usuario</p:outputLabel></td>
										<td><p:selectOneMenu id="usuario"
												value="#{CompraBean.usuarioCorreo}">

												<f:selectItems value="#{CompraBean.usuarios}" var="usu"
													itemLabel="#{usu.nombre}" itemValue="#{usu.correo}" />

											</p:selectOneMenu></td>
										<td><p:commandButton id="btnUsu" value="Buscar"
												action="#{CompraBean.buscarUsuario}" ajax="false"></p:commandButton>
										</td>

									</tr>
									<tr>
										<td><p:outputLabel>Compra</p:outputLabel></td>
										<td><p:selectOneMenu id="compra"
												value="#{CompraBean.compra}">

												<f:selectItems value="#{CompraBean.compras}" var="comp"
													itemLabel="#{comp.fechacompra}"
													itemValue="#{comp.idcompra}" />

											</p:selectOneMenu></td>
										<td><p:commandButton id="btnComp" value="Buscar"
												action="#{CompraBean.buscarCompra}" ajax="false"></p:commandButton>
										</td>

									</tr>
									<tr>
										<td><p:outputLabel>Fecha Compra</p:outputLabel></td>
										<td><p:outputLabel value="#{CompraBean.fechaCompra}"></p:outputLabel>
										</td>
									</tr>


									<tr>
										<td><p:outputLabel>Fecha Entrega</p:outputLabel></td>
										<td><p:outputLabel value="#{CompraBean.fechaEntrega}"></p:outputLabel>
										</td>
									</tr>

									<tr>
										<td><p:outputLabel>Estado</p:outputLabel></td>
										<td><p:selectOneMenu id="estado"
												value="#{CompraBean.estado}">

												<f:selectItems value="#{CompraBean.estados}" var="est"
													itemLabel="#{est.nombreestado} "
													itemValue="#{est.idestado}" />

											</p:selectOneMenu></td>

										<td><p:commandButton id="btnCambiar" value="Cambiar"
												action="#{CompraBean.modificarCompra}" ajax="false"></p:commandButton>
										</td>
									</tr>


								</table>
							</p:panel>

							<p:panel header="Detalles">

								<p:dataTable var="detalle" value="#{CompraBean.detalles}"
									emptyMessage="No hay Detalles." scrollable="true"
									scrollHeight="150">

									<p:column headerText="Cantidad">
										<h:outputText value="#{detalle.cantidad}" />
									</p:column>

									<p:column headerText="Precio Venta">
										<h:outputText value="#{detalle.precioventa}" />
									</p:column>

								</p:dataTable>
								<h:outputText value="#{CompraBean.mensaje}" />
							</p:panel>

						</h:form>

					</div>
					<!--Inner contact-->
				</section>
				<!--End contact-->


				<!--Footer-->
				<section id="footer">
					<div class="innerFooter">
						<p>Junio 2013. Online Store Retailer</p>
					</div>
				</section>
				<!--End footer -->
			</div>


			<!--End inner Content-->
		</div>
		<!--End main content-->

	</div>
	<!--End wrapper-->

	<!-- /TEMPLATE -->


</h:body>
</html>